win32 theme: Implement horizontal spinbuttons
authorBenjamin Otte <otte@gnome.org>
Wed, 2 Mar 2016 06:51:54 +0000 (07:51 +0100)
committerBenjamin Otte <otte@gnome.org>
Wed, 2 Mar 2016 13:49:37 +0000 (14:49 +0100)
gtk/theme/win32/gtk-win32-base.css

index a017bf6f3a9f8389e401a9faa7d7c54e92134ac6..35a2ac6f65bf36a122454b9358b028943b36ed52 100644 (file)
@@ -711,54 +711,79 @@ entry.flat:disabled {
     color: -gtk-win32-color(edit, graytext);
 }
 
-/* Spibuttons */
+/* Spinbutton (horizontal) */
 
-spinbutton button,
-spinbutton button:focus {
-    background-color: transparent;
-    background-image: -gtk-win32-theme-part(spin, 2, 1, margins(0 -1 -1 -1));
-    color: rgba(0, 0, 0, 0);
+spinbutton.horizontal  {
+  padding: 2px 1px;
+  background-image: -gtk-win32-theme-part(edit, 1, 1);
 }
 
-spinbutton button:last-child,
-spinbutton button:focus:last-child {
-    background-image: -gtk-win32-theme-part(spin, 1, 1, margins(-1 -1 0 -1));
+spinbutton.horizontal:focus {
+    background-image: -gtk-win32-theme-part(edit, 1, 3);
 }
 
-spinbutton button:hover,
-spinbutton button:hover:focus {
-    background-image: -gtk-win32-theme-part(spin, 2, 2, margins(0 -1 -1 -1));
+spinbutton.horizontal:disabled {
+    background-image: -gtk-win32-theme-part(edit, 1, 4);
 }
 
-spinbutton button:hover:last-child,
-spinbutton button:hover:focus:last-child {
-    background-image: -gtk-win32-theme-part(spin, 1, 2, margins(-1 -1 0 -1));
+spinbutton.horizontal entry {
+  all: unset;
+  padding: 0px calc(1em/3);
 }
 
+spinbutton.horizontal button {
+  all: unset;
+  color: transparent;
+  min-width: 15px;
+  min-height: 9px;
+  background-size: 15px 9px;
+  background-repeat: no-repeat;
+}
 
-spinbutton button:active,
-spinbutton button:active:hover,
-spinbutton button:active:focus,
-spinbutton button:active:hover:focus {
-    background-image: -gtk-win32-theme-part(spin, 2, 3, margins(0 -1 -1 -1));
+spinbutton.horizontal button.down {
+  background-image: -gtk-win32-theme-part(spin, 2, 1);
+  background-position: top center;
+  padding-left: 1px;
+  margin-left: -1px;
+  margin-top: 8px;
+  margin-bottom: -8px;
+  margin-right: -1px;
 }
 
-spinbutton button:active:last-child,
-spinbutton button:active:hover:last-child,
-spinbutton button:active:focus:last-child,
-spinbutton button:active:hover:focus:last-child {
-    background-image: -gtk-win32-theme-part(spin, 1, 3, margins(-1 -1 0 -1));
+spinbutton.horizontal button.up {
+  background-image: -gtk-win32-theme-part(spin, 1, 1);
+  background-position: bottom center;
+  margin-top: -8px;
+  margin-bottom: 8px;
+  margin-left: -16px;
+  margin-right: -1px;
 }
 
-spinbutton button:disabled {
-    background-image: -gtk-win32-theme-part(spin, 2, 4, margins(0 -1 -1 -1));
+spinbutton.horizontal button.down:hover {
+    background-image: -gtk-win32-theme-part(spin, 2, 2);
 }
 
-spinbutton button:disabled:last-child {
-    background-image: -gtk-win32-theme-part(spin, 1, 4, margins(-1 -1 0 -1));
+spinbutton.horizontal button.up:hover {
+    background-image: -gtk-win32-theme-part(spin, 1, 2);
+}
+
+spinbutton.horizontal button.down:active {
+    background-image: -gtk-win32-theme-part(spin, 2, 3);
 }
 
+spinbutton.horizontal button.up:active {
+    background-image: -gtk-win32-theme-part(spin, 1, 3);
+}
+
+spinbutton.horizontal button.down:disabled {
+    background-image: -gtk-win32-theme-part(spin, 2, 4);
+}
+
+spinbutton.horizontal button.up:disabled {
+    background-image: -gtk-win32-theme-part(spin, 1, 4);
+}
 
+/* Spinbutton (vertical) */
 
 spinbutton.vertical button,
 spinbutton.vertical button:focus {